{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import cv2\n",
    "from PIL import Image,ImageOps\n",
    "from utils import *"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# vizualize results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "loss = read_loss_file('loss_350.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "val_loss = read_loss_file('val_loss_350.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "vizualize_results(loss, val_loss, type='loss')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# predict an image"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\Admin\\Anaconda3\\envs\\environment\\lib\\site-packages\\keras_applications\\resnet50.py:265: UserWarning: The output shape of `ResNet50(include_top=False)` has been changed since Keras 2.2.0.\n",
      "  warnings.warn('The output shape of `ResNet50(include_top=False)` '\n"
     ]
    }
   ],
   "source": [
    "from model import *\n",
    "model = LeafCountingModel()\n",
    "model.load_weights('model_weighs/model_125_ver5.h5')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "image = preprocess_image('E:/Dataset/A5/rgb_00_009_02.png', size=(240, 240))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers).\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x1e4b0b1f808>"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQEAAAD8CAYAAAB3lxGOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8GearUAAAgAElEQVR4nO3deXxU1fnH8c8z2QmQsASEBAQ0WKAWhIiKFBAVkaqgRcAiUIulUqnYqhVEVNSChYLCTxQEWYsVrChY6oKIFUWBsAqyKmBCQthDSMg2Ob8/7gQiJGSbmTvL8+Y1r0lu7sx5MiTfnLn33HPEGINSKng57C5AKWUvDQGlgpyGgFJBTkNAqSCnIaBUkNMQUCrIeSwERKSniOwWkX0iMspT7Silqkc8MU5AREKAPcCtQCqwAbjPGPOd2xtTSlWLp3oCHYF9xpgfjDH5wNtAbw+1pZSqhlAPPW88kFLi81TgurJ2rl+/vmnWrJmHSvExG3+A8BZwtd2FqGCzcePGY8aYuAu3eyoEpJRtP3nfISLDgGEATZs2JTk52UOl+BBjSImOpklOEHyvyueIyMHStnvq7UAq0KTE5wlAWskdjDFvGGOSjDFJcXEXhVNASt64kYEk2V2GUj/hqZ7ABiBRRJoDh4ABwG881Jbf6NGjB0fuOGJ3GUr9hEdCwBhTKCIjgI+BEGCOMWaHJ9ryG3PnQm4uvGV3IUr9lKd6Ahhj/gv811PP729efOklnnnmGRwOHZ+lfIvHQkCVMGYMnQ4dovOwYRoCyufoT6QXDFu7lisWLCC8dm27S1HqIhoCHjZy5Ejmr11Lbps2EKodL+V7NAQ8yRhOnTzJsoICEu2uRaky6J8mD8obN46ChQuJ+OwzHC1b2l2OUqXSnoCnZGUx/tQpPgEiAaS0QZRK2U9DwEOOvPMOaVOnMuWKK7ghJ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sdW32u9fa7hDYACSKSHMRCQcGAMttrukiIhItIrWKPwZ6ANuxah3i2m0IsMyeCstVVp3LgcGuI9fXA5nFXVm7XfB++W6s1xusmgeISISINAcSgfU21CfAm8BOY8yUEl/yu9fa9iOTWEdN92Ad5R1jdz1l1NgC64j0VmBHcZ1APWAVsNd1X9cHav0XVve5AOuvz9Cy6sTqok53vfbfAkk+VPNCV03bsH6BGpXYf4yr5t3A7TbV3BmrO78N62r3La6fZZ9+rUu76YhBpYKc3W8HlFI20xBQKshpCCgV5DQElApyGgJKBTkNAaWCnIaAUkFOQ0CpIPf/PL44A0wWQaEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.imshow(image)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "5.837914"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.predict(np.expand_dims(image, axis=0))[0,0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "from werkzeug.utils import secure_filename"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'abc.png'"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "secure_filename('abc.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
